package com.winterchen.queue;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @className HelloSender
 * @Description 发送者
 * @Author Administrator
 * @Date 2018/9/21 0021 16:51
 * @Version 1.0
 **/
@Component
public class HelloSender2 {
    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send(int i) {
        String context = "hello World !";
        /*System.out.println("Sender : " + context );*/
        rabbitTemplate.convertAndSend("hello",context + "***************" + i);
    }

}
